package com.cn.ant.modules.wechat.service;

import com.cn.ant.common.service.BaseService;
import com.cn.ant.modules.wechat.dao.AutoResponseMapper;
import com.cn.ant.modules.wechat.entity.AutoResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional(readOnly = true)
public class AutoResponseService extends BaseService {
    @Autowired
    private AutoResponseMapper autoResponseMapper;

    public AutoResponse get(String id) {
        return autoResponseMapper.get(id);
    }

    @Transactional(readOnly = false)
    public void save(AutoResponse autoResponse) {
        autoResponseMapper.insert(autoResponse);
    }

    @Transactional(readOnly = false)
    public void update(AutoResponse autoResponse) {
        autoResponseMapper.update(autoResponse);
    }

    @Transactional(readOnly = false)
    public void delete(String id) {
        autoResponseMapper.delete(id);
    }

    public List<AutoResponse> query(Map<String,Object> param) {
        return autoResponseMapper.query(param);
    }

}
